﻿@using PEETS.Models;
@using Microsoft.AspNet.Identity;
@model PEETS.Models.User

@{
    ViewBag.Title = "Gérer votre compte";
}

<h3 style="text-decoration: underline">Modifier votre profil</h3>
<h5 style="color: orangered">Votre courriel et votre numéro de téléphone seront affichés dans les détails de vos offres publiées et actives.</h5>

<div style="height: 150px;padding-top: 10px" class="col-md-12 row;">

    <div>
        <label>Nom utilisateur: </label> <span>@Html.DisplayFor(m => m.NomUtil)</span>
    </div>
    <div>
        <label>Courriel: </label> <span>@Html.DisplayFor(m => m.Email)</span>
    </div>
    <div>
        <label>Téléphone: </label> <span>@Html.DisplayFor(m => m.PhoneNumber)</span>
    </div>
    <div style="padding-top: 7px" class="col-md-6">
        <a href="#modifCompteDialog" class="btn btn-warning" data-toggle="modal">Modifier</a>
    </div>

</div>

<h3 style="text-decoration: underline">Supprimer votre compte</h3>

<div class="row col-md-12" style="height: 150px;margin-top: 5px">

    <div style="padding-top: 5px" class="col-md-6">
        <a href="#desactiverCompteDialog" class="btn btn-danger" data-toggle="modal">Supprimer</a>
    </div>

</div>
    
@using (Html.BeginForm("ModifyAccount", "Account", FormMethod.Post))
{
    <div class="modal fade" id="modifCompteDialog" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header" style="background-color: #59822c">
                    <a href="#" class="close" data-dismiss="modal">&times;</a>
                    <h4 style="color: white!important">Modification du compte</h4>
                </div>
                <div class="modal-body">
                    <div>
                        <label style="width: 150px">Courriel</label> @Html.TextBoxFor(m => m.Email, null, new { style = "width: 200px" }) <span style="font-weight: bolder;color: red"> *</span>
                        @Html.ValidationMessageFor(m => m.Email)
                    </div>
                    <div>
                        <label style="width: 150px">Téléphone</label> @Html.TextBoxFor(m => m.PhoneNumber, null, new { style = "width: 200px" })
                        @Html.ValidationMessageFor(m => m.PhoneNumber)
                    </div>
                </div>
                <div class="modal-footer">
                    <span class="form-group">
                        <input type="submit" class="btn btn-success btn-sm" value="Modifier" />
                    </span>
                    <button class="btn btn-danger btn-sm" data-dismiss="modal"> Annuler</button>
                </div>
            </div>
            @Html.HiddenFor(m => m.NomUtil)
        </div>
    </div>
}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

@using (Html.BeginForm("RemoveAccountList", "Account", FormMethod.Post))
{
    <div class="modal fade" id="desactiverCompteDialog" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header" style="background-color: #9a161a">
                    <a href="#" class="close" data-dismiss="modal">&times;</a>
                    <h4 style="color: white!important">Supprimer le compte</h4>
                </div>
                <div class="modal-body">
                    Votre compte sera supprimé définitivement. Cliquez sur le bouton [Supprimer] pour continuer.           
                </div>
                <div class="modal-footer">
                    @{

                    }
                    <span class="form-group">
                        <input type="submit" class="btn btn-default btn-sm" value="Supprimer" />
                    </span>
                    <button class="btn btn-danger btn-sm" data-dismiss="modal"> Annuler</button>
                </div>
            </div>
        </div>
    </div>
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    <script src="~/Scripts/Manage.js"></script>
    <script src="~/Scripts/bootstrap-filestyle-0.1.0.min.js"> </script>
}